var url="";
var model;
var request;
var Rizhi;
var result=false;
function LoadData(){
    result = false;
    Rizhi.page =1 ;
    request.post('http://'+url+'/app/OperateLog!ajaxOperateLog?projectId='+GetQueryString('projectId')+'&pageno='+Rizhi.page).success(function(data){
        // if(data!=null&&data.length==0){
        //    $("#no-data").html("<div style='margin:100px auto;width:200px;height:100px;position: relative;text-align:center;'><img  style='position: relative;' src='image/nodata.png' width='62' height='66'/><br/><span style='font-size:14px;color:rgb(141,141,141);'>没有相关出差内容!</span></div>");
        // $("body").removeClass("liststyle");
        //  }else
        //  {
        //   $("#no-data").html("");
        //   $("body").addClass("liststyle");
        //  }
        Rizhi.list = data;
        console.log(data);
        result=true;
         }).error(function(data,status,headers,config){
      if((status>=200&&status<300)||status===304||status===1223||status===0){
      $("body").html("网络访问出错！");
      }
      });
}

(function(){
	var app=angular.module('Rizhi',[ ]);
	app.controller('RizhiController',['$http','$window',function($http,$window){
        Rizhi=this;
		request=$http;
    url = "120.26.110.125/jncloud";
    bindEvent();
    LoadData();
		$window.onscroll=function(){
             var scrollTop=$(this).scrollTop();
             var windowHeight = $(this).height();
             var scrollHeight =document.body.scrollHeight;
             if(scrollTop + windowHeight >= scrollHeight){
				Rizhi.page++;
				$http.post('http://'+url+'/app/OperateLog!ajaxOperateLog?projectId=1&pageno='+Rizhi.page).success(function(data){
					Rizhi.list=Rizhi.list.concat(data);
				}).error(function(data, status, headers, config){
				if(( status>= 200 && status < 300 ) || status === 304 || status === 1223 || status === 0)
				{
				$("body").html("网络访问出错！");
				}
				});
			}
		}
	}]);
})();
